package org.summer.common.http;

/**
 * 全局同意http响应状态码枚举类
 * @author wjj9132
 * @date 2024/9/26 8:43
 * @since 1.0
 */
public enum ResultCode {
    SUCCESS(200, "请求成功"),
    LOGIN_SUCCESS(200, "用户登录成功"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    UNAUTHORIZED(401, "用户未经过认证"),
    LOGIN_FAILURE(402,"用户登录失败"),
    LOGIN_FAILURE_USER_NOT_FOUND(4021,"登录失败,用户名不存在"),
    LOGIN_FAILURE_PASSWORD_ERROR(4022,"登录失败,用户密码错误"),
    LOGIN_FAILURE_USER_DISABLED(4023,"登录失败,用户禁用"),
    LOGIN_FAILURE_USER_LOCKED(4024,"登录失败,用户锁定"),
    LOGIN_FAILURE_PASSWORD_EXPIRED(4025,"登录失败,用户密码过期"),
    LOGIN_FAILURE_USER_EXPIRED(4026,"登录失败,用户账户过期"),
    LOGIN_FAILURE_JWT_CREATE_ERROR(4030,"用户登录失败,系统构建用户jwt令牌出现错误"),
    FORBIDDEN(403, "用户权限不足,拒绝权限访问"),
    TOKEN_EXPIRE(424,"用户登录令牌过期,请重新登录"),
    FAIL(-1, "请求失败,未知错误");

    private final int code;
    private final String message;
    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public int code() {
        return code;
    }
    public String message() {
        return message;
    }
}
